﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace wfaFoxMigrator
{
    public partial class frmReWriteData : Form
    {
        public ListItem CurrentListItem { get; set; }
        public string Message { get; set; }
        public bool ShowChkAlwaysDoIt { get; set; }            
        public delegate void OnReWriteDataAnswer(DialogResult DialogResult, bool Persistance, ListItem lst);
        public event OnReWriteDataAnswer ReWriteDataAnswer;
        
        public frmReWriteData()
        {
            InitializeComponent();
            chkAlwaysDoIt.Visible = ShowChkAlwaysDoIt;
            lblMessage.Text = Message;
        }

        private void btnAccept_Click(object sender, EventArgs e)
        {
            ReWriteDataAnswer(DialogResult.Yes, chkAlwaysDoIt.Checked, CurrentListItem);
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            ReWriteDataAnswer(DialogResult.No, chkAlwaysDoIt.Checked, CurrentListItem);
            this.Close();
        }        
    }    
}
